chore: add prettier for markdown and astro formatting#2153
Conversation
…provider, context, hooks, and query utilities are now exported from `@namehash/namehash-ui`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR establishes Prettier as a code formatter across the monorepo, primarily for Markdown and Astro files. It configures Prettier with a 100-character print width, registers the Astro plugin with specialized parsing options, updates root and docs-site package scripts to run both Prettier and Biome in coordinated lint workflows, pins versions in the workspace catalog, and documents the formatting approach for contributors. ChangesPrettier Formatting Infrastructure
🎯 2 (Simple) | ⏱️ ~10 minutes Suggested Labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR introduces Prettier into the monorepo to standardize formatting for Markdown at the root and Astro files within the docs workspaces, complementing Biome (which handles the rest of the codebase).
Changes:
- Add Prettier (and Astro plugin) to the pnpm catalog/lockfile and introduce root-level
.prettierrc.json/.prettierignore. - Update root
lint/lint:cito run Prettier on Markdown and run workspace-level Astro format checks where available. - Add docs workspace Prettier configs and
format/format:checkscripts for.astrofiles.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Adds prettier and prettier-plugin-astro to the shared catalog. |
| pnpm-lock.yaml | Locks new Prettier dependencies and updates related Astro dependency snapshots. |
| package.json | Updates lint scripts to include Prettier checks/writes and adds Prettier devDependency. |
| docs/ensrainbow.io/package.json | Adds format scripts and Prettier devDependencies for .astro formatting. |
| docs/ensrainbow.io/.prettierrc.json | Adds Astro-specific Prettier configuration via prettier-plugin-astro. |
| docs/ensrainbow.io/.prettierignore | Excludes build artifacts from Prettier in the docs workspace. |
| docs/ensnode.io/package.json | Adds format scripts and Prettier devDependencies for .astro formatting. |
| docs/ensnode.io/.prettierrc.json | Adds Astro-specific Prettier configuration via prettier-plugin-astro. |
| docs/ensnode.io/.prettierignore | Excludes build artifacts from Prettier in the docs workspace. |
| .prettierrc.json | Introduces root Prettier defaults for Markdown/prose formatting. |
| .prettierignore | Excludes generated/owned files (e.g. lockfile, changelogs) from Prettier. |
| .changeset/upset-kids-drop.md | Adds a changeset entry (content currently appears unrelated to this PR). |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
docs/ensnode.io/.prettierrc.json (1)
1-13:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd base Prettier options to avoid config drift.
Line 1 introduces a workspace-local config that can diverge from root defaults; this risks inconsistent formatting in
docs/ensnode.io. Please include the shared base options here (printWidth,proseWrap) so this package stays aligned.Proposed patch
{ "plugins": ["prettier-plugin-astro"], + "printWidth": 100, + "proseWrap": "preserve", "overrides": [ { "files": "*.astro", "options": { "parser": "astro" } } ], "bracketSameLine": true, "astroSkipFrontmatter": true }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/ensnode.io/.prettierrc.json` around lines 1 - 13, Add the shared base Prettier options to this package's .prettierrc.json to prevent config drift: add top-level "printWidth" and "proseWrap" keys to the existing JSON using the workspace's canonical values (e.g., set "printWidth" to the repo/monorepo default and "proseWrap" to the repo default like "preserve" or "always"), keeping the existing "plugins", "overrides", "bracketSameLine", and "astroSkipFrontmatter" entries intact so the file remains a superset of the root config.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CONTRIBUTING.md`:
- Around line 27-30: Replace the unclear NOTE that begins "NOTE (Windows users):
After running these steps, you may see many diffs with Contents have differences
only in line separators comment." with a concise, user-facing explanation that
Windows line endings (CRLF) can cause many harmless diffs and that those changes
are not included in the final commit; instruct the reader to either ignore those
diffs for self-review or normalize line endings by running the existing
suggested command (git add --all) or configuring Git line-ending handling (e.g.,
core.autocrlf), and keep the guidance brief and action-oriented so it's easy to
understand.
In `@docs/ensrainbow.io/package.json`:
- Around line 15-17: The package CI lint script "lint:ci" only runs Biome and
therefore skips the Astro Prettier check; update the "lint:ci" script to invoke
the existing "lint:prettier:ci" before (or in parallel with) Biome so CI will
fail on unformatted Astro files — for example, change "lint:ci" to run
"lint:prettier:ci" and then "biome ci" (reference script names: "lint:ci" and
"lint:prettier:ci").
---
Duplicate comments:
In `@docs/ensnode.io/.prettierrc.json`:
- Around line 1-13: Add the shared base Prettier options to this package's
.prettierrc.json to prevent config drift: add top-level "printWidth" and
"proseWrap" keys to the existing JSON using the workspace's canonical values
(e.g., set "printWidth" to the repo/monorepo default and "proseWrap" to the repo
default like "preserve" or "always"), keeping the existing "plugins",
"overrides", "bracketSameLine", and "astroSkipFrontmatter" entries intact so the
file remains a superset of the root config.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: a45f2baf-b5f8-44a4-ae07-db6be6b72c0b
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
.prettierignore.prettierrc.jsonCONTRIBUTING.mddocs/ensnode.io/.prettierignoredocs/ensnode.io/.prettierrc.jsondocs/ensnode.io/package.jsondocs/ensrainbow.io/.prettierignoredocs/ensrainbow.io/.prettierrc.jsondocs/ensrainbow.io/package.jsonpackage.jsonpnpm-workspace.yaml
| "lint:ci": "biome ci", | ||
| "lint:prettier": "prettier --write \"**/*.astro\"", | ||
| "lint:prettier:ci": "prettier --check \"**/*.astro\"" |
There was a problem hiding this comment.
Include Prettier check in package-level CI lint entrypoint.
At Line 15, lint:ci runs only Biome, so Astro formatting can be skipped when CI/job tooling invokes just pnpm run lint:ci in this package. Wire lint:prettier:ci into lint:ci to preserve the “block unformatted files” guarantee.
Suggested patch
- "lint:ci": "biome ci",
+ "lint:ci": "pnpm run lint:prettier:ci && biome ci",
"lint:prettier": "prettier --write \"**/*.astro\"",
"lint:prettier:ci": "prettier --check \"**/*.astro\""📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "lint:ci": "biome ci", | |
| "lint:prettier": "prettier --write \"**/*.astro\"", | |
| "lint:prettier:ci": "prettier --check \"**/*.astro\"" | |
| "lint:ci": "pnpm run lint:prettier:ci && biome ci", | |
| "lint:prettier": "prettier --write \"**/*.astro\"", | |
| "lint:prettier:ci": "prettier --check \"**/*.astro\"" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/ensrainbow.io/package.json` around lines 15 - 17, The package CI lint
script "lint:ci" only runs Biome and therefore skips the Astro Prettier check;
update the "lint:ci" script to invoke the existing "lint:prettier:ci" before (or
in parallel with) Biome so CI will fail on unformatted Astro files — for
example, change "lint:ci" to run "lint:prettier:ci" and then "biome ci"
(reference script names: "lint:ci" and "lint:prettier:ci").
There was a problem hiding this comment.
@notrab — the suggestion is worth keeping, in my view. Here's the reasoning:
The root package.json already dispatches both formatters via the regex pattern pnpm run "/^lint:(prettier|biome):ci$/", so workspace-wide CI is covered. However, if any CI job (or developer) targets this package directly with:
pnpm --filter `@docs/ensrainbow` run lint:ci…only Biome runs and the Prettier check for .astro files is silently skipped. That breaks the "block unformatted files" guarantee at the package level.
The fix is minimal — it just chains the already-existing lint:prettier:ci script:
"lint:ci": "pnpm run lint:prettier:ci && biome ci",It might also be worth checking whether docs/ensnode.io/package.json has the same gap for consistency, since both packages follow the same pattern.
🧠 Learnings used
Learnt from: tk-o
Repo: namehash/ensnode PR: 1752
File: packages/ensnode-schema/package.json:19-23
Timestamp: 2026-03-12T11:05:50.976Z
Learning: In pnpm monorepos (identified by catalog references in package.json), use publishConfig.exports to override the top-level exports for the published artifact (e.g., ./dist/*.js) while keeping top-level exports for local development (e.g., ./src/*.ts). Treat this pattern as intentional and not broken. Apply this guideline to package.json files in monorepos (e.g., packages/**/package.json) or any package.json where catalog references indicate a monorepo layout.
| "lint:prettier": "pnpm exec prettier --write \"**/*.md\" && pnpm -r lint:prettier", | ||
| "lint:prettier:ci": "pnpm exec prettier --check \"**/*.md\" && pnpm -r lint:prettier:ci", |
There was a problem hiding this comment.
{md,mdx} is mentioned here, and running also catches mdx files.
| "lint": "pnpm run \"/^lint:(prettier|biome)$/\"", | ||
| "lint:ci": "pnpm run \"/^lint:(prettier|biome):ci$/\"", | ||
| "lint:prettier": "pnpm exec prettier --write \"**/*.md\" && pnpm -r lint:prettier", | ||
| "lint:prettier:ci": "pnpm exec prettier --check \"**/*.md\" && pnpm -r lint:prettier:ci", | ||
| "lint:biome": "biome check --write .", | ||
| "lint:biome:ci": "biome ci", |
| "astro": "astro", | ||
| "lint": "biome check --write .", | ||
| "lint:ci": "biome ci" | ||
| "lint:ci": "biome ci", |
| "astro": "astro", | ||
| "lint": "biome check --write .", | ||
| "lint:ci": "biome ci" | ||
| "lint:ci": "biome ci", |
| > NOTE (Windows users): After running these steps, you may see many diffs with Contents have differences only in line separators comment. | ||
| > | ||
| > These files won't be included in your commit. For easier self-review either ignore them or (if valid in your case) run the git add --all command. This normalizes line endings and removes those entries from the diff. |
| "astro": "astro", | ||
| "lint": "biome check --write .", | ||
| "lint:ci": "biome ci" | ||
| "lint:ci": "biome ci", |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| "lint:prettier": "pnpm exec prettier --write \"**/*.md\" && pnpm -r lint:prettier", | ||
| "lint:prettier:ci": "pnpm exec prettier --check \"**/*.md\" && pnpm -r lint:prettier:ci", |
| "lint": "pnpm run \"/^lint:(prettier|biome)$/\"", | ||
| "lint:ci": "pnpm run \"/^lint:(prettier|biome):ci$/\"", | ||
| "lint:prettier": "pnpm exec prettier --write \"**/*.md\" && pnpm -r lint:prettier", | ||
| "lint:prettier:ci": "pnpm exec prettier --check \"**/*.md\" && pnpm -r lint:prettier:ci", | ||
| "lint:biome": "biome check --write .", | ||
| "lint:biome:ci": "biome ci", |
Lite PR
Tip: Review docs on the ENSNode PR process
Summary
**/*.astroinsidedocs/ensnode.ioanddocs/ensrainbow.ioviaprettier-plugin-astro, withastroSkipFrontmatter: trueso Biome still owns the---block.The new root scripts (thanks @shrugs 🫶 ):
Each docs site exposes its own
lint:prettier/lint:prettier:cifor**/*.astro.pnpm run "/regex/"runs the matched scripts in parallel.CONTRIBUTING.mdgets a short section on the Biome+Prettier split, mirroring the ENSAwards repo.Why
CONTRIBUTING.md,.changeset/, both docs sites.).astrosupport only covers the frontmatter. Prettier withprettier-plugin-astrohandles the template;astroSkipFrontmatter: trueprevents the two from clashing.The
lint:prettier/lint:biomesplit runs both tools in parallel and replaces the previousformat/lintasymmetry.Testing
pnpm installsucceeds.pnpm lintruns Prettier and Biome in parallel and writes locally.pnpm lint:ciruns both check-only; failures exit non-zero..astrofrontmatter survives a Prettier pass untouched.CHANGELOG.mdfiles survive a Prettier pass untouched.Notes for Reviewer (Optional)
.prettierrc.jsonand.prettierignoreat root..prettierignoreis required to keep Prettier offCHANGELOG.md(changesets-owned) (package.json#prettierhas no equivalent for ignore patterns.)We need to consider when we merge this... as running the lint beyond merging this will cause significant changes to

md/mdx/astrofiles.CHANGELOG.mdignored (owned by changesets)astroSkipFrontmatterlets biome keep formatting.astroscript blocksdocs/ensnode.io and docs/ensrainbow.ioown.astroviaprettier-plugin-astroPre-Review Checklist (Blocking)